class DrawData {

  _data := [], _undo := []

  Push(v) => this._data.Push(v)
  Pop(v) => this._data.Length && this._data.Pop(v)

  Undo(step) {
    loop step {
      if !this._data.Length
        return
      this._undo.Push this._data.Pop()
    }
  }

  Redo(step) {
    loop step {
      if !this._undo.Length
        return
      this._data.Push this._undo.Pop()
    }
  }

  ClearUndo() => this._undo.Length := 0
}